import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 商品列表查询 */
export const getGoodsList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/goods/page"), {
    params: filerEmptyVal(params)
  });
};

/** 商品详情 */
export const getGoodsDetail = id => {
  return http.request<any>(
    "get",
    baseUrlApi("/index/goods/detail?goodsId=" + id)
  );
};

/** 添加购物车 */
export const addShopCart = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/shoppingCart/add"), { data });
};
